/**
 * ...
 * @author Krzysztof Rozalski
 */

package hapi.physics;
import hapi.math.Vector2D;
import haxe.FastList;

class ResultantForce {
	
	var components:FastList<Force>;

	public function new() {
		this.components = new FastList<Force>();
	}
	
	public function addComponent(f) {
		components.add(f);
	}
	
	public function removeComponent(f) {
		components.remove(f);
	}
	
	public function calcResultantForce() {
		var resultant = Force.zero();
		for ( component in components ) {
			resultant.add(component);
		}
		return resultant;
	}
}